home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 10 / The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso / PC_SIGCD / 05 / 6 / DISK0564.ZIP / SOURCE.ARC / B.ARC / KEY.AS < prev    next >
Text File  |  1986-04-09  |  758b  |  48 lines

  1. ;    routines to access bios    keyboard services
  2. ;    written    for Aztec C86 v. 3.20e
  3. ;    by Jon Dart, Feb. 1986
  4.  
  5. MODEL equ 0        ;small code, small data
  6.  
  7. include     lmacros.h
  8.  
  9. bios_int equ 22
  10.  
  11. ;  int keyin(c)
  12. ;  /* returns 1    if key ready, 0    if not */
  13. ;  char    *c;
  14. codeseg    segment
  15. procdef    keyin,<<arg1,ptr>>
  16.     pushds
  17.     push si
  18.     ldptr si,arg1      ;get pointer to char
  19.     mov  ah,1
  20.     int  bios_int      ;call    bios
  21.     jz   navail      ;if no char.
  22.     push ax
  23.     mov  ah,0
  24.     int  bios_int      ;remove char.    from buffer
  25.     pop  ax
  26.     mov  [si],al      ;set char.
  27.     mov  ax,1
  28.     jmp  exit
  29. navail:
  30.     xor  ax,ax
  31. exit:    pop  si
  32.     popds
  33.     pret
  34.     pend keyin
  35.  
  36. procdef    clrco            ;clear type-ahead
  37.     pushds
  38.     mov  ah,3
  39.     int  bios_int
  40.     popds
  41.     pret
  42.     pend clrco
  43.  
  44. codeseg    ends
  45.     end
  46.  
  47.  
  48.